<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=
    , initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-on 指令</title>
</head>
<body>


    <div id="itany">
        <button v-on:click="show">点我</button>    
        <button v-on:click="add">向数组添加一个元素</button>       
        <br/>
        {{ arr }}    
        <br/>
        <button v-on:mouseover="show">鼠标经过</button>    
        <button v-on:dblclick="show">鼠标双击</button>    
    </div>
      
    
</body>
<script src="../utils/vue.js"></script>
<script>
    new Vue({
     el:"#itany",
     data: { //存储数据
        arr:[12,34,56,78]   
     },
     methods:{
         show:function(){
             console.log("show方法")
         },
         add(){
            this.arr.push(666); //使用this访问实例当中的属性
            this.show();
         }
     }

    })
</script>
</html>